/**
 * Created by nena on 2018/3/22.
 */
const SUCCESS = 0;
const ERR_UNKNOWN = -10000;

const ERR_GET_MODEL = 10001;

const ERR_PARAMETER = 11000;
const ERR_PARAMETER_UNAVAILABLE = 11002;

let erros = {}
erros[ERR_PARAMETER] = 'received parameters error';
erros[ERR_PARAMETER_UNAVAILABLE] = 'received unavailable data, please check';

function getErrInfo(errCode) {
    let ret = {};
    ret.errCode = errCode;
    let err = erros[errCode];
    if (errCode === SUCCESS) {
        ret.result = {};
    } else {
        ret.errInfo = err ? err : erros[ERR_UNKNOWN];
    }
    return ret;
}


module.exports = {
    getErrInfo,
    SUCCESS,
    ERR_GET_MODEL,
    ERR_PARAMETER,
    ERR_PARAMETER_UNAVAILABLE
}